import React, { useState, useEffect } from 'react';
import './App.css';
import Login from './components/LoginF';
import { GetVersion } from "./axios/api"

function App() {
  const [version, setVersion] = useState(null);
  const [time, setTime] = useState(null);
  useEffect(() => {
    GetVersion().then((res)=>{
      setVersion(res.data);
    })
    setTime(new Date().toLocaleString().replace(/:\d{1,2}$/, ' '));
  }, []);

  return (
    <div>
      <div className="App">
        <Login />
      </div>
      <div style={{ fontSize: '1rem', marginLeft: '25%', marginTop: '10%' }}>

        版本号：<span id='version'>{version}</span>
        时间：<span id='time'>{new Date().toLocaleString().replace(/:\d{1,2}$/, ' ')}</span>
      </div>
    </div>
  );
}

export default App;
